<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__CSS__/pintuer.css">
<link rel="stylesheet" href="__CSS__/admin.css">
<script src="__JS__/jquery.js"></script>
<script src="__JS__/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>修改内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U('Art/artUpdate')}" enctype="multipart/form-data">
      <div class="form-group">
        <div class="label">
          <label>标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$title}" name="title" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>图片：</label>
        </div>
        <div class="field">
          <input type="text" id="url1" name="img" class="input tips" style="width:25%; float:left;"  value="{$pic}"  data-toggle="hover" data-place="right" data-image="__ROOT__/{$pic}" />
          <input type="button" class="button bg-blue margin-left" id="image1" value="+ 浏览上传"  style="float:left;">
          <input type="file" name="pic" style="FILTER: alpha(opacity=0); moz-opacity: 0; opacity: 0;" />
          <div class="tipss">图片尺寸：500*500</div>
        </div>
      </div>
      <script>
        $("#image1").on("click",function(){
          jQuery('input:file').trigger('click');
        });
        jQuery('input:file').change(function(){
            //dosomthing
            var url = getFullPath(this);
            $("#url1").val(url).attr("data-image",url);
        });
        function getFullPath(obj){
          if(obj)
          {
            //ie
            if (window.navigator.userAgent.indexOf("MSIE")>=1)
           {
            obj.select();
            return document.selection.createRange().text;
           }
           //firefox
           else if(window.navigator.userAgent.indexOf("Firefox")>=1)
           {
            if(obj.files)
           {
            return obj.files.item(0).getAsDataURL();
           }
            return obj.value;
           }
            return obj.value;
          }
        }
      </script>

        <div class="form-group">
          <div class="label">
            <label>分类标题：</label>
          </div>
          <div class="field">
              <select name="cat_id" class="input w50">
                  <php>$cat_arr=array("$cat_id"=>'selected');</php>
                  <foreach name="list" item="v">
                      //2017-07-02改
                      <option value="{$v.cat_id}" {$cat_arr[$v['cat_id']]}>
                          <for start="0" end="$v.lv">&nbsp&nbsp</for>{$v.cat_name}
                      </option>
                    <!-- <if condition="$v.cat_id eq $cat_id">
                        <option value="{$v.cat_id}" selected="selected">
                            <for start="0" end="$v.lv">&nbsp&nbsp</for>{$v.cat_name}
                        </option>
                    <else />
                        <option value="{$v.cat_id}">
                            <for start="0" end="$v.lv">&nbsp&nbsp</for>{$v.cat_name}
                        </option>
                    </if> -->
                  </foreach>
                </select>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>其他属性：</label>
          </div>
          <div class="field" style="padding-top:8px;">
           <!--  首页 <input id="ishome"  type="checkbox" /> -->
            推荐 <input id="recommended"  type="checkbox" value="1" name="recommended" {$recommended?"checked=true":""}/>
            置顶 <input id="istop"  type="checkbox" value="1" name="istop" {$istop?"checked=true":""}/>

          </div>
        </div>

      <div class="form-group">
        <div class="label">
          <label>摘要：</label>
        </div>
        <div class="field">
          <textarea class="input" name="excerpt" style=" height:90px;">{$excerpt}</textarea>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>内容：</label>
        </div>
        <script type="text/javascript" charset="utf-8" src="__PUBLIC__/u/ueditor.config.js"></script>
          <script type="text/javascript" charset="utf-8" src="__PUBLIC__/u/ueditor.all.min.js"> </script>
          <script type="text/javascript" charset="utf-8" src="__PUBLIC__/u/lang/zh-cn/zh-cn.js"></script>

       <!--  <div class="field">
          <textarea name="content" class="input" style="height:150px; border:1px solid #ddd;"></textarea>
          <div class="tips"></div>
        </div> -->
        <div class="field">
          <script id="editor" type="text/plain" name="content" style="width:800px;height:300px;">{$content}</script>
        </div>
          <script type="text/javascript">
            //实例化编辑器
            //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
            var ue = UE.getEditor('editor');
           </script>
      </div>

      <div class="clear"></div>
      <div class="form-group">
        <div class="label">
          <label>关键字标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="seo_title" value="{$seo_title}" />
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>关键字：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="seo_keywords" value="{$seo_keywords}"/>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>关键字描述：</label>
        </div>
        <div class="field">
          <textarea type="text" class="input" name="seo_desc" style="height:80px;" >{$seo_desc}</textarea>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>排序：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="sort" value="{$sort}"  data-validate="number:排序必须为数字" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>发布时间：</label>
        </div>
        <div class="field">
          <script src="__JS__/laydate/laydate.js"></script>
          <input type="text" class="laydate-icon input w50" name="pubtime" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value="{$pubtime}"  data-validate="required:日期不能为空" style="padding:10px!important; height:auto!important;border:1px solid #ddd!important;" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>作者：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="authour" value="{$authour}"  />
          <div class="tips"></div>
        </div>
      </div>
      <!-- <div class="form-group">
        <div class="label">
          <label>点击次数：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="views" value="" data-validate="member:只能为数字"  />
          <div class="tips"></div>
        </div>
      </div> -->
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <input type="hidden" name="art_id" value="{$art_id}">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

</body></html>
